package com.xbongbong.pro.coolapp.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;


/**
 * @Author: hongxiao
 * @date: 2022-07-02 10:50
 */
@Getter
@Setter
@ToString
public class CoolAppWorkflowCardDTO extends BaseDTO {
    private static final long serialVersionUID = 7482131237656961867L;

    /**
     * 群id
     */
    private String openConversationId;

    private Long formId;

    private Long appId;

    private Long menuId;

    /**
     * saas业务标记
     */
    private Integer saasMark;

    /**
     * saas业务类型
     */
    private Integer businessType;

    private Integer subBusinessType;

    /**
     * 上一个任务id，重新提交审批会生成新的任务id
     * 是否发送卡片需要查询上一个任务id
     */
    private Long preTaskId;
    /**
     * 任务id
     */
    private Long taskId;
    /**
     * 所属工作流id
     */
    private Long workflowId;
    /**
     * 流程状态
     */
    private Integer flowStatus;
    /**
     * 数据id
     */
    private Long dataId;


    /**
     * 审批操作类型
     * @see com.xbongbong.paas.enums.TaskTypeEnum
     */
    private Integer taskType;

    public CoolAppWorkflowCardDTO() {}

    public CoolAppWorkflowCardDTO(String corpid, UserVO userVO, String platform, String openConversationId, Long appId, Long menuId,
                                  Long formId, Integer saasMark, Integer businessType, Long taskId, Long workflowId, Long dataId,
                                  Integer flowStatus, Integer taskType) {
        this.openConversationId = openConversationId;
        this.appId = appId;
        this.menuId = menuId;
        this.formId = formId;
        this.saasMark = saasMark;
        this.businessType = businessType;
        this.taskId = taskId;
        this.workflowId = workflowId;
        this.dataId = dataId;
        this.flowStatus = flowStatus;
        this.taskType = taskType;

        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
    }
}
